package com.itboye.lottery.activity.user;

import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;
import android.view.View;

import com.itboye.lottery.base.BaseActivity;
import com.itboye.lottery.R;
import com.itboye.lottery.adapter.CommonPagerAdapter;
import com.itboye.lottery.fragment.user.MessageFragment;

import java.util.ArrayList;

public class MessageCenterActivity extends BaseActivity {


    private ArrayList<Fragment> orderFragments;
    TabLayout tb_message_center;
    ViewPager vp_message_center;

    @Override
    protected int getLayoutId() {
        return R.layout.activity_message_center;
    }

    @Override
    protected void initData() {
        initViewPager();
    }

    private void initViewPager() {
        orderFragments = new ArrayList();
        orderFragments.add(MessageFragment.newInstance(0, ""));
        orderFragments.add(MessageFragment.newInstance(1, ""));
        vp_message_center.setAdapter(new CommonPagerAdapter(this, orderFragments, R.array.message_center_title, getSupportFragmentManager()));
        tb_message_center.setupWithViewPager(vp_message_center);
        vp_message_center.setCurrentItem(getIntent().getIntExtra("order_position", 0), false);
    }

    @Override
    public void onClick(View view) {

    }
}
